# -*- coding:utf-8 -*-
#定义一个装饰器例子
# 实现日志的输出

#定义一个基本方法
def show():
  print "this is show method"



#定义一个装饰器方法
def decoratoruse(func):
  print "do it by func execute"
  func()
  print "do after func execute"
  return func

decoratoruse(show)



# 定义装饰器方法并使用
# 代码会首先执行定义的装饰器函数


def me(func):
    print("running in me")
    return  func

def message():
    print("this is running")
@me
def show():
    message()
    print(" this in show")


show()






